﻿
Partial Class store_manuals
    Inherits CSearchPage

#Region "Data"
    Private m_products As CProductList
    Public ReadOnly Property [Products]() As CProductList
        Get
            If IsNothing(m_products) Then
                m_products = CProduct.Cache.Active.Manuals
            End If
            Return m_products
        End Get
    End Property
    Protected Overrides ReadOnly Property TypeId As SchemaMikeConnellMinistries.EProductType
        Get
            Return EProductType.Manual
        End Get
    End Property
#End Region

#Region "Menu"
    Protected Overrides ReadOnly Property TopPanel As System.Web.UI.WebControls.PlaceHolder
        Get
            Return plhTopLinks
        End Get
    End Property
    Protected Overrides ReadOnly Property SubPanel As System.Web.UI.WebControls.PlaceHolder
        Get
            Return plhSubLinks
        End Get
    End Property
#End Region

#Region "Event Handlers - Page"
    Protected Overrides Sub PageInit()
        With Request.FilePath.ToLower
            If .Contains("/store/") OrElse .Contains("/mobile/") OrElse .Contains("training_manuals.aspx") Then Response.RedirectPermanent(CSitemap.Manuals(Search, SpeakerId)) 'Renamed page
        End With

        lnkDonate.NavigateUrl = CSitemap.External_Donations
    End Sub
    Protected Overrides Sub PagePreRender()
        For Each i As CProduct In Products
            UCManual(plh).Display(i)
        Next
    End Sub
#End Region

#Region "Event Handlers - Form"
#End Region

#Region "User Controls"
    Private Shared Function UCManual(ByVal target As Control) As store_UCManual
        Dim ctrl As Control = target.Page.LoadControl(CSitemap.Store_UCManual)
        target.Controls.Add(ctrl)
        Return CType(ctrl, store_UCManual)
    End Function
#End Region

End Class
